/***用户管理 四个模块 */
import http from '@/utils/http'
enum Api {
    saveOrUpdateApi = '/api/channel/saveOrUpdate',
    channelPageApi = '/api/channel/page',
    channelListApi = '/api/channel/list',
    channelLinkApi = '/api/channel/generateLink',//生成链接
    channelDetailApi = '/api/channel/detail',
    channelDeleteApi = '/api/channel/delete',
    channelDeleteAllocateProductApi = '/api/channel/deleteAllocateProduct', // 删除关联产品
    channelAllocateProductApi = '/api/channel/allocateProduct', //关联产品 废弃
    channelRelationProductListApi = '/api/channel/relationProductList', //关联产品显示 ？
    channelRelationProductPageApi = '/api/channel/relationProductPage', //关联产品显示



    merchantSaveOrUpdateApi = '/api/channel/merchant/saveOrUpdate',
    merchantSaveOrUpdateAttachmentApi = '/api/channel/merchant/saveOrUpdateAttachment',
    merchantPageApi = '/api/channel/merchant/page',
    merchantListApi = '/api/channel/merchant/list', // 
    merchantDetailApi = '/api/channel/merchant/detail',
    merchantDeleteAttachmentApi = '/api/channel/merchant/deleteAttachment',
    merchantDeleteApi = '/api/channel/merchant/delete',


    supplierSaveOrUpdateApi = '/api/supplier/saveOrUpdate',
    supplierPageApi = '/api/supplier/page',
    supplierDetailApi = '/api/supplier/detail',
    supplierDeleteApi = '/api/supplier/delete',



    accountDisableOrEnableApi = '/api/system/account/disableOrEnable', // 禁止/启用
    accountPasswordApi = '/api/system/account/change/password', // 修改密码
    accountSaveOrUpdateApi = '/api/system/account/saveOrUpdate', // 新增/修改
    accountPageApi = '/api/system/account/page', // 分页查询
    accountMyApi = '/api/system/account/my', // 账户详情
    accountAllocateRoleApi = '/api/system/account/allocateRole', // 账户详情
    accountDetailApi = '/api/system/account/detail', // 详情通过id查询
    accountDeleteApi = '/api/system/account/delete', // 删除
    accountRelationRoleListApi = '/api/system/account/relationRoleList', // 权限反显


    roleDisableOrEnableApi = '/api/system/role/disableOrEnable', // 启用/禁用
    roleSaveOrUpdateApi = '/api/system/role/saveOrUpdate', // 新增/修改
    rolePageApi = '/api/system/role/page', // 分页查询
    roleListApi = '/api/system/role/list', // 列表查询
    roleAllocateAuthorityApi = '/api/system/role/allocateAuthority', // 权限分配
    roleDetailApi = '/api/system/role/detail', // 详情
    roleDeleteApi = '/api/system/role/delete', // 删除
    roleRelationAuthorityListApi = '/api/system/role/relationAuthorityList', // 角色关联权限

    // 渠道附加信息管理-API
    additionalSave= '/api/channel/additional/saveOrUpdateBatch',
    additionalPage= '/api/channel/additional/page',
    additionalList= '/api/channel/additional/list',
    additionalDetail= '/api/channel/additional/detail',
    additionalDelete= '/api/channel/additional/delete',
}

/*********************************系统角色管理api**************************** */
export const additionalDetailGet = async (params:any) => {
    return http.getRestApi(Api.additionalDetail,params)
}
export const additionalDeleteDel = async (params:any) => {
    return http.delete(Api.additionalDelete,params)
}
export const additionalSavePost = async (params:any) => {
    return http.post(Api.additionalSave,params)
}
export const additionalPagePost = async (params:any) => {
    return http.post(Api.additionalPage,params)
}
export const additionalListPost = async (params:any) => {
    return http.post(Api.additionalList,params)
}

export const roleDisableOrEnableApiPut = async (params:any) => {
    return http.put(Api.roleDisableOrEnableApi,params)
}

export const roleSaveOrUpdateApiPost = async (params:any) => {
    return http.post(Api.roleSaveOrUpdateApi,params)
}
export const rolePageApiPost = async (params:any) => {
    return http.post(Api.rolePageApi,params)
}
export const roleListApiPost = async (params:any) => {
    return http.post(Api.roleListApi,params)
}
export const roleAllocateAuthorityApiPost = async (params:any) => {
    return http.post(Api.roleAllocateAuthorityApi,params)
}


export const roleDetailApiGet = async (params:any) => {
    return http.getRestApi(Api.roleDetailApi,params)
}
export const roleDeleteApiDelete = async (params:any) => {
    return http.delete(Api.roleDeleteApi,params)
}
export const roleRelationAuthorityListApiPost = async (params:any) => {
    return http.post(Api.roleRelationAuthorityListApi,params)
}


/*********************************供应商api**************************** */
// 新增或则修改
export const saveOrUpdateApiPost = async (params: any) => {
    return http.post(Api.saveOrUpdateApi, params)
}
// 分页
export const channelPageApiPost = async (params:any) => {
    return http.post(Api.channelPageApi,params)
}
// 删除关联产品
export const channelDeleteAllocateProductApiDel = async (params:any) => {
    return http.delete(Api.channelDeleteAllocateProductApi,params)
}
// 删除
export const channelListApiPost = async (params:any) => {
    return http.post(Api.channelListApi,params)
}
// 链接
export const channelLinkApiPost = async (params:any) => {
    return http.post(Api.channelLinkApi,params)
}
// 查询详情
export const channelDetailApiGet = async (params:any) => {
    return http.getRestApi(Api.channelDetailApi,params)
}
// 删除
export const channelDeleteApiDelete = async (params:any) => {
    return http.delete(Api.channelDeleteApi,params)
}
// 关联产品
export const channelAllocateProductApiPost = async (params:any) => {
    return http.post(Api.channelAllocateProductApi,params)
}
// 关联产品显示
export const channelRelationProductListApiPost = async (params:any) => {
    return http.post(Api.channelRelationProductListApi,params)
}
export const channelRelationProductPageApiPost = async (params:any) => {
    return http.post(Api.channelRelationProductPageApi,params)
}


/*********************************渠道管理api**************************** */
export const merchantSaveOrUpdateApiPost = async (params:any) => {
    return http.post(Api.merchantSaveOrUpdateApi,params)
}
export const merchantSaveOrUpdateAttachmentApiPost = async (params:any) => {
    return http.post(Api.merchantSaveOrUpdateAttachmentApi,params)
}
export const merchantPageApiPost = async (params:any) => {
    return http.post(`${Api.merchantPageApi}?isShow=${params.isShow}`,params)
}
export const merchantListApiPost = async (params:any) => {
    return http.post(Api.merchantListApi,params)
}
export const merchantDetailApiGet = async (params:any) => {
    return http.getRestApi(Api.merchantDetailApi,params)
}
export const merchantDeleteAttachmentApiDelete = async (params:any) => {
    return http.delete(Api.merchantDeleteAttachmentApi,params)
}
export const merchantDeleteApiDelete = async (params:any) => {
    return http.delete(Api.merchantDeleteApi,params)
}
/*********************************供应商api**************************** */



export const supplierSaveOrUpdateApiPost = async (params:any) => {
    return http.post(Api.supplierSaveOrUpdateApi,params)
}
export const supplierPageApiPost = async (params:any) => {
    return http.post(Api.supplierPageApi,params)
}
export const supplierDetailApiGet = async (params:any) => {
    return http.getRestApi(Api.supplierDetailApi,params)
}
export const supplierDeleteApiDelete = async (params:any) => {
    return http.delete(Api.supplierDeleteApi,params)
}
/*********************************广告位api**************************** */
/*********************************员工管理api**************************** */

export const accountDisableOrEnableApiPut = async (params:any) => {
    return http.put(Api.accountDisableOrEnableApi,params)
}
export const accountPasswordApiPut = async (params:any) => {
    return http.put(Api.accountPasswordApi,params)
}
export const accountSaveOrUpdateApiPost = async (params:any) => {
    return http.post(Api.accountSaveOrUpdateApi,params)
}
export const accountPageApiPost = async (params:any) => {

    return http.post(`${Api.accountPageApi}?isShow=${params.isShow}`,params)
}

// 查询详情
export const accountMyApiGet = async () => {
    return http.get(Api.accountMyApi)
}
export const accountAllocateRoleApiPost = async (params:any) => {
    return http.post(Api.accountAllocateRoleApi,params)
}
// 删除
export const accountDetailApiGet = async (params:any) => {
    return http.getRestApi(Api.accountDetailApi,params)
}
export const accountDeleteApiDelete = async (params:any) => {
    return http.delete(Api.accountDeleteApi,params)
}
export const accountRelationRoleListApiPost = async (params:any) => {
    return http.post(Api.accountRelationRoleListApi,params)
}